home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Utilities / Password Dictionaries / Dictmake.exe / dos / dictmake.c next >
Encoding:
C/C++ Source or Header  |  1997-11-11  |  1.5 KB  |  74 lines

  1. /*
  2. DictMaker v1.0
  3. Written By: E-HACK (god@wilter.com)
  4.  
  5. Copyright ⌐ 1997 Wiltered Fire
  6. All Rights Reserved.
  7. */
  8.  
  9.  
  10.  
  11. #include <stdio.h>
  12. #include <stdlib.h>
  13. #include <time.h>
  14.  
  15. static char *letters[] = { "a","b","c","d","e","f","g","h","i","j","k","l","m",
  16.             "n","o","p","q","r","s","t","u","v","w","x","y","z","A",
  17.             "B","C","D","E","F","G","H","I","J","K","L","M","N","O",
  18.             "P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2",
  19.             "3","4","5","6","7","8","9" };
  20.                                                         
  21. main()
  22. {
  23. int i, chars, c, passwords, d;
  24. char *letter, *filename;
  25. FILE *fp;
  26. time_t t;
  27.  
  28. srand((unsigned) time(&t));
  29.  
  30. printf("\nDictMaker v1.0\nWritten By: E-HACK\n\n");
  31.  
  32. printf("Output file: ");
  33. scanf("%s", filename);
  34.  
  35. printf("Number of characters: ");
  36. scanf("%d", &chars);
  37.  
  38. if(chars <= 1) {
  39. printf("Not enough characters!");
  40. return(0);
  41. }
  42.  
  43. printf("Number of passwords: ");
  44. scanf("%d", &passwords);
  45. d = 1;
  46. fp = fopen(filename, "w");
  47. fflush(fp);
  48. if(fp == NULL) {
  49. printf("\nUnable to write to %s", filename);
  50. return(0);
  51. }
  52. printf("\nCreating %s with %d passwords", filename, passwords);
  53. if(passwords >= 20000) { printf("...\nThis might take a while"); }
  54.  
  55.  
  56. while(d <= passwords)
  57. {
  58. d++;
  59.  
  60. c = 1;
  61. while(c <= chars)
  62. {
  63. c++;
  64. i = rand() % 62;
  65. letter = letters[i];
  66. fprintf(fp, "%s", letter);
  67. }
  68. fputs("\n", fp);
  69. }
  70. fclose(fp);
  71. printf("\n\nDone writing %d passwords to %s\a", passwords, filename);
  72. return(0);
  73. }
  74.